package com.searchschool.bean;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;


@Entity (name="NET")
@Table (name="tbnet")
public class Net implements Serializable {
	
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue ( strategy=GenerationType.TABLE, generator="NET_GEN")
	@TableGenerator(name="NET_GEN", table="tbsequence", pkColumnName="SEQ_NAME", valueColumnName="SEQ_COUNT", pkColumnValue="NET", allocationSize=1	)
	private int idnet;
	private String namenet;
	@OneToOne ( optional=true, cascade=CascadeType.ALL,
		    mappedBy="net" , targetEntity=School.class
		)
	private School school;
	
	
	public Net(){
		
	}
	
	public Net(int idnet, String namenet) {
		super();
		this.idnet = idnet;
		this.namenet = namenet;
	}

	public int getIdnet() {
		return idnet;
	}
	public void setIdnet(int idnet) {
		this.idnet = idnet;
	}
	public String getNamenet() {
		return namenet;
	}
	public void setNamenet(String namenet) {
		this.namenet = namenet;
	}

	public School getSchool() {
		return school;
	}

	public void setSchool(School school) {
		this.school = school;
	}
	
}
